package com.example.competionmanagebackend.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.competionmanagebackend.entity.Registrations;
import com.example.competionmanagebackend.mapper.RegistrationsMapper;
import com.example.competionmanagebackend.service.RegistrationsService;
import org.springframework.stereotype.Service;

/**
 * 报名信息服务实现类
 */
@Service
public class RegistrationsServiceImpl extends ServiceImpl<RegistrationsMapper, Registrations>
        implements RegistrationsService {

    @Override
    public Page<Registrations> getRegistrationsPage(int currentPage, int pageSize) {
        return this.page(new Page<>(currentPage, pageSize));
    }

    @Override
    public Registrations getRegistrationById(Integer id) {
        return this.getById(id);
    }

    @Override
    public void insertRegistration(Registrations registration) {
        this.save(registration);
    }

    @Override
    public void updateRegistration(Registrations registration) {
        this.updateById(registration);
    }

    @Override
    public void deleteRegistration(Integer id) {
        this.removeById(id);
    }
}